package com.bytecollege.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author xigua
 * @date 2022/10/20  9:26
 */
@Configuration
public class MybatisConfig {
    
    /***
    * @Description: mybatisplus分页拦截器配置
    * @Param: []
    * @return: com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
    * @Author: xigua
    * @Date: 2022/10/20
    */
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor interceptor=new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }

}
